<!--
 * @Author: Seon.Hu SeonHu@126.com
 * @Date: 2023-06-16 15:13:37
 * @LastEditors: Seon.Hu SeonHu@126.com
 * @LastEditTime: 2023-11-27 17:51:23
 * @FilePath: \bg-vben\src\views\sys\login\LoginFormTitle.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <h2 class="mb-3 text-2xl font-bold text-center xl:text-3xl enter-x xl:text-left">
    {{ getFormTitle }}
  </h2>
</template>

<script lang="ts" setup>
  import { computed, unref } from 'vue';

  import { useI18n } from '@/hooks/web/useI18n';
  import { LoginStateEnum, useLoginState } from './useLogin';

  const { t } = useI18n();

  const { getLoginState } = useLoginState();

  const getFormTitle = computed(() => {
    const titleObj = {
      [LoginStateEnum.RESET_PASSWORD]: t('sys.login.forgetFormTitle'),
      [LoginStateEnum.LOGIN]: t('sys.login.signInFormTitle'),
      [LoginStateEnum.REGISTER]: t('sys.login.signUpFormTitle'),
      [LoginStateEnum.REGISTER_RESULT]: t('sys.login.signUpResultFormTitle'),
      [LoginStateEnum.MOBILE]: t('sys.login.mobileSignInFormTitle'),
      [LoginStateEnum.QR_CODE]: t('sys.login.qrSignInFormTitle'),
      [LoginStateEnum.SEND_CONFIRM_EMAIL]: t('sys.login.sendConfirmEmailFormTitle'),
      [LoginStateEnum.CONFIRM_PHONE]: t('sys.login.confirmPhoneFormTitle'),
      [LoginStateEnum.CONFIRM_RESULT]: t('sys.login.confirmResultFormTitle'),
    };
    return titleObj[unref(getLoginState)];
  });
</script>
